check for 0 value on the denominator in the horizontal case just like we
authorGeorge Lebl <jirka@5z.com>
Sun, 9 Dec 2001 22:32:50 +0000 (22:32 +0000)
committerGeorge Lebl <jirka@src.gnome.org>
Sun, 9 Dec 2001 22:32:50 +0000 (22:32 +0000)
Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>

* gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
  denominator in the horizontal case just like we do in the vertical
  case (why I didn't notice that there were two cases the first time
  around is beyond me:).  Also fix indentation in the vertical case.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkrange.c

index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 16104c32f030ae44c301acde206f7de65db05b5b..c2609f8f2f5c85dd28dceceff246e7007385eb05 100644 (file)
@@ -1,3 +1,10 @@
+Sun Dec 09 15:06:51 2001  George Lebl <jirka@5z.com>
+
+       * gtk/gtkrange.c (gtk_range_calc_layout): check for 0 value on the
+         denominator in the horizontal case just like we do in the vertical
+         case (why I didn't notice that there were two cases the first time
+         around is beyond me:).  Also fix indentation in the vertical case.
+
 2001-12-09  Anders Carlsson  <andersca@gnu.org>
 
        * gdk/x11/gdkevents-x11.c: Update xsettings name.
index 429aa4fe253b55d2cb9f2cdf27f5d043b8688301..bc6219ccb3b7842553d235c82ab38fbb01f07f04 100644 (file)
@@ -2019,8 +2019,8 @@ gtk_range_calc_layout (GtkRange *range,
         y = top;
         
        if (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size != 0)
-               y += (bottom - top - height) * ((adjustment_value - range->adjustment->lower) /
-                                               (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
+         y += (bottom - top - height) * ((adjustment_value - range->adjustment->lower) /
+                                         (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
         
         y = CLAMP (y, top, bottom);
         
@@ -2154,8 +2154,9 @@ gtk_range_calc_layout (GtkRange *range,
         
         x = left;
         
-        x += (right - left - width) * ((adjustment_value - range->adjustment->lower) /
-                                       (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
+       if (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size != 0)
+          x += (right - left - width) * ((adjustment_value - range->adjustment->lower) /
+                                         (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
         
         x = CLAMP (x, left, right);